package com.kuang.mapper;

import com.kuang.pojo.User;
import lombok.Data;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

@Data
//Bean named 'userMapper' is expected to be of type 'com.kuang.mapper.UserMapper' but was actually of type 'com.kuang.mapper.UserMapperImpl'
//public class UserMapperImpl{
public class UserMapperImpl implements UserMapper{
    public SqlSessionTemplate sqlSession;

//    @Bean
    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

//    public SqlSessionTemplate getSqlSession() {
//        return sqlSession;
//    }

//    public void setsqlsession(SqlSessionTemplate sqlsession) {
//        this.sqlSession = sqlsession;
//    }

    public List<User> selectUser() {
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        return mapper.selectUser();
    }
}
